//
//  UIColor+Hex.h
//  NineteenBook
//
//  Created by xhkj on 2021/8/2.
//  Copyright © 2021 58阅读. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIColor (Hex)

+ (UIColor *)colorWithHexString:(NSString *)stringToConvert andAlpha:(CGFloat)alpha;

+ (UIColor *)colorWithHexValue:(NSInteger)color alpha:(CGFloat)alpha;

+ (UIColor *)colorWithHexValue:(NSInteger)color;

+ (CGFloat)redColorFromHexRGBColor:(NSInteger)hex;

+ (CGFloat)greenColorFromRGBColor:(NSInteger)hex;

+ (CGFloat)blueColorFromRGBColor:(NSInteger)hex;

- (void)getColorComponentsWithRed:(CGFloat *)red
                            green:(CGFloat *)green
                             blue:(CGFloat *)blue
                            alpha:(CGFloat *)alpha;

+ (UIColor*)gradientFromColor:(UIColor*)c1
                      toColor:(UIColor*)c2
                   withHeight:(int)height;

@end

NS_ASSUME_NONNULL_END
